import time

from selenium import webdriver
from selenium.webdriver import Keys, ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.edge.service import Service

if __name__ == '__main__':
    exe_path = "../driver/msedgedriver.exe"
    service = Service(executable_path=exe_path)
    brower = webdriver.Edge(service=service)
    brower.maximize_window()
    brower.get(url="https://www.jd.com")

    # 打开一个空的选项卡
    # brower.execute_script("window.open()")
    # brower.execute_script("window.open('https://www.baidu.com')")
    # 参数为整数，向右向下滚动
    brower.execute_script("window.scroll(0, 800)")
    time.sleep(10)
    brower.execute_script("window.scroll(0, -800)")

    time.sleep(10)
    brower.quit()